import 'package:flutter_test/flutter_test.dart';

import 'package:compact_dio/compact_dio.dart';

class BaseIntercepter extends Interceptor {
  @override
  void onRequest(RequestOptions options, RequestInterceptorHandler handler) {
    super.onRequest(options, handler);
  }
}

void main() {
  TestWidgetsFlutterBinding.ensureInitialized();
  test('adds one to input values', () async {
    const url = 'https://wyapi.vvxing.cn';
    final params = {'id': '120605500'};

    FlutterCompactDio.config
      ..setBaseUrl(url)
      ..setConnectTimeout(1000)
      ..enableCheckConnectivity(false)
      ..addInterceptor(BaseIntercepter())
      ..create();
    final result = await CompactDio.get(
      '/digitalAlbum/detail',
      params: params,
      dialog: false,
      baseUrl: url,
    );
    expect(result.success, true);
  });
}
